package com.huiquan.framework.utils;

public class StringUpperUtil {

    // 转大写。除了希腊字母
    public static String changeStr(String str){
        if(str == null) {
            return "";
        }
        str.toUpperCase();
        char[] ch = str.toCharArray();
        StringBuffer sb = new StringBuffer();
        int a = 'A'-'a';   //获得大小写之间差值
        for(int i = 0; i < ch.length; i++){
            if('a' <= ch[i] && ch[i] <= 'z'){
                ch[i] = (char)(ch[i]+a);
            }
            sb.append(ch[i]);
        }

        return sb.toString();
    }
    public static void main(String[] arg0){
        System.out.println(changeStr("发发呆αfdsafas"));
    }
}
